const styleFunction = function(feature) {
    let cod = feature.get('cod');

    // 确定cod的最小最大值，这里假定为minCod和maxCod
    // 实际应用中，你可能需要从数据集中计算出这些值
    const minCod = 0; // 示例最小值
    const maxCod = 150; // 示例最大值

    // 计算每一份的边界值
    const step = (maxCod - minCod) / 5;

    if (cod <= minCod + step) {
        return new ol.style.Style({
            stroke: new ol.style.Stroke({
                color: '#3381ff',
                width: 1,
            })
        });
    } else if (cod <= minCod + 2 * step) {
        return new ol.style.Style({
            stroke: new ol.style.Stroke({
                color: '#33e4ff', // 绿色
                width: 1,
            })
        });
    } else if (cod <= minCod + 3 * step) {
        return new ol.style.Style({
            stroke: new ol.style.Stroke({
                color: '#33fcff', // 橙色
                width: 1,
            })
        });
    } else if (cod <= minCod + 4 * step) {
        return new ol.style.Style({
            stroke: new ol.style.Stroke({
                color: '#d9534f', // 红色
                width: 1,
            })
        });
    } else {
        return new ol.style.Style({
            stroke: new ol.style.Stroke({
                color: '#e53a3a', // 蓝绿色
                width: 1,
            })
        });
    }
}